<?php

Route::get('/', function () {
    echo "jifneihu";
    exit;
});

Route::group(['namespace' => 'Backend',], function () {
    Route::get('login', 'User\LoginController@showLoginForm');
    Route::post('login', 'User\LoginController@signIn');
//用户退出
    Route::get('logout', 'User\LoginController@logout');
});

//操作权限页面
//所有后台关于后台的路由
Route::group(['namespace' => 'Backend', 'prefix' => '', 'middleware' => ['ifadmin', 'pjax'],], function () {
    //日志管理
    Route::resource('log', 'Log\LogController');
    //用户管理
    Route::resource('user', 'User\UserController');
    //角色管理
    Route::resource('role', 'Role\RoleController');
    //权限管理
    Route::resource('permissions', 'Permissions\PermissionsController');
    //轮播图
    Route::resource('rotation', 'Rotation\RotationController');
    //学员列表
    Route::resource('student', 'Student\StudentController');

    //课程列表
    Route::resource('dances', 'Dances\DancesController');
    //预约课程
    Route::resource('courseBooking', 'Dances\CourseBookingController');

    Route::get('student/buyLogView/{id}', 'Student\StudentController@buyLogView');
    Route::delete('student/buyLogDelete/{id}', 'Student\StudentController@buyLogDelete');


    Route::get('permission/permissionsView/{id}', 'Permissions\PermissionsController@permissionsView');
    Route::get('permission/menusView/{id}', 'Permissions\PermissionsController@menusView');
    Route::post('permission/permissionsCreate', 'Permissions\PermissionsController@permissionsCreate');
    //首页
    Route::get('index', 'Index\IndexController@index');
    //上传图片
    Route::post('uploadImage', 'User\UploadController@index');
    
    //网站设置
    Route::get('about', 'About\AboutController@index');
    Route::post('about/update', 'About\AboutController@update');
});
Route::group(['namespace' => 'Backend', 'prefix' => '', 'middleware' => 'menus',], function () {
    Route::get('401', 'Error\ErrorController@index');
});
